

namespace gen {
 
    template <typename S>
    template <typename InfoT>
	void
	kleene_star<S>::generate(InfoT & info) const
    {
		typedef typename InfoT::iterator_t	iterator_t;
		typedef domain<iterator_t>			domain_t;
		typedef typename InfoT::multi_domain_t	multi_domain_t;

		multi_domain_t & domain = info.domain();
		iterator_t saveIte = info.current();
		if (saveIte+1 != domain.last()) {
			domain_t saveDomain = domain.swapDomain(domain_t(domain.first(), domain.last()));
			info.current(saveIte+1);
			this->subject().generate(info);
			info.current(saveIte);
			domain.swapDomain(saveDomain);
		}
    }
    
    ///////////////////////////////////////////////////////////////////////////
    //
    //  kleene_star class implementation
    //
    ///////////////////////////////////////////////////////////////////////////
    template <typename S>
    inline kleene_star<S>
    operator*(generator<S> const& a)
    {
        return kleene_star<S>(a.derived());
    }

}
